Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore case while filtering completions #6008

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

pascalkuthe
Copy link
Member

@pascalkuthe pascalkuthe commented Feb 15, 2023

Fixes #2017

This PR changes the fuzzy matching in the completion menu to be always case insensitive.
We never really documented that it used smart casing and I don't think that is actually desirable here.
A common use-case for competitions is mistyping/misremembering an identifier and using autocomplete to fixup that problem. For that use-case case sensitive matching is actually detrimental. Other editors like nvim/vscode/intellij also seem to always use case insensitive auto completions.

Note that the original reproduction case from #2017 already seems to work:
case_insensitive

However after this fix the following also works which doesn't work on master (see screenshot)

case_sensitive_comp

Note that we rank completions by their fuzzy matching score which gives a penalty for case mismatch in case ignore case is enabled soo if both Foo and FOO exist both would show up but Foo would be ranked first.

@pascalkuthe pascalkuthe added C-enhancement Category: Improvements S-waiting-on-review Status: Awaiting review from a maintainer. E-easy Call for participation: Experience needed to fix: Easy / not much A-helix-term Area: Helix term improvements labels Feb 15, 2023
@archseer archseer merged commit c332b16 into helix-editor:master Feb 16, 2023
@pascalkuthe pascalkuthe deleted the case_insensitive_comple branch February 16, 2023 02:22
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LSP completions are case sensitive; add option to have them be case insensitive
2 participants